package com.bdqn.demo.controller;

import com.bdqn.demo.comm.KtjiaoyuInfo;
import com.bdqn.demo.service.DomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController// @RestController 的意思是 Controller 里面的方法都以 JSON 格式输出
public class HelloController {
    @Value("${KtjiaoyuInfo.name}")
    private String name;
    @Value("${KtjiaoyuInfo.email}")
    private String email;
    @Resource
    private KtjiaoyuInfo ktjiaoyuInfo;
    @Autowired
    private DomeService domeService;
    @RequestMapping("/hello")
    public String hello(){
        String msg=domeService.sayHello();
        msg+=""+name+""+email;
        return msg;
    }
}
